Integrand size = 24, antiderivative size = 307 \[ \int \frac {(e x)^{-1+2 n}}{a+b \text {sech}\left (c+d x^n\right )} \, dx=\frac {(e x)^{2 n}}{2 a e n}-\frac {b x^{-n} (e x)^{2 n} \log \left (1+\frac {a e^{c+d x^n}}{b-\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d e n}+\frac {b x^{-n} (e x)^{2 n} \log \left (1+\frac {a e^{c+d x^n}}{b+\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d e n}-\frac {b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,-\frac {a e^{c+d x^n}}{b-\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d^2 e n}+\frac {b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,-\frac {a e^{c+d x^n}}{b+\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d^2 e n} \]
[Out]
Time = 0.42 (sec) , antiderivative size = 307, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {5548, 5544, 4276, 3401, 2296, 2221, 2317, 2438} \[ \int \frac {(e x)^{-1+2 n}}{a+b \text {sech}\left (c+d x^n\right )} \, dx=-\frac {b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,-\frac {a e^{d x^n+c}}{b-\sqrt {b^2-a^2}}\right )}{a d^2 e n \sqrt {b^2-a^2}}+\frac {b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,-\frac {a e^{d x^n+c}}{b+\sqrt {b^2-a^2}}\right )}{a d^2 e n \sqrt {b^2-a^2}}-\frac {b x^{-n} (e x)^{2 n} \log \left (\frac {a e^{c+d x^n}}{b-\sqrt {b^2-a^2}}+1\right )}{a d e n \sqrt {b^2-a^2}}+\frac {b x^{-n} (e x)^{2 n} \log \left (\frac {a e^{c+d x^n}}{\sqrt {b^2-a^2}+b}+1\right )}{a d e n \sqrt {b^2-a^2}}+\frac {(e x)^{2 n}}{2 a e n} \]
[In]
[Out]
Rule 2221
Rule 2296
Rule 2317
Rule 2438
Rule 3401
Rule 4276
Rule 5544
Rule 5548
Rubi steps \begin{align*} \text {integral}& = \frac {\left (x^{-2 n} (e x)^{2 n}\right ) \int \frac {x^{-1+2 n}}{a+b \text {sech}\left (c+d x^n\right )} \, dx}{e} \\ & = \frac {\left (x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int \frac {x}{a+b \text {sech}(c+d x)} \, dx,x,x^n\right )}{e n} \\ & = \frac {\left (x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int \left (\frac {x}{a}-\frac {b x}{a (b+a \cosh (c+d x))}\right ) \, dx,x,x^n\right )}{e n} \\ & = \frac {(e x)^{2 n}}{2 a e n}-\frac {\left (b x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int \frac {x}{b+a \cosh (c+d x)} \, dx,x,x^n\right )}{a e n} \\ & = \frac {(e x)^{2 n}}{2 a e n}-\frac {\left (2 b x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int \frac {e^{c+d x} x}{a+2 b e^{c+d x}+a e^{2 (c+d x)}} \, dx,x,x^n\right )}{a e n} \\ & = \frac {(e x)^{2 n}}{2 a e n}-\frac {\left (2 b x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int \frac {e^{c+d x} x}{2 b-2 \sqrt {-a^2+b^2}+2 a e^{c+d x}} \, dx,x,x^n\right )}{\sqrt {-a^2+b^2} e n}+\frac {\left (2 b x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int \frac {e^{c+d x} x}{2 b+2 \sqrt {-a^2+b^2}+2 a e^{c+d x}} \, dx,x,x^n\right )}{\sqrt {-a^2+b^2} e n} \\ & = \frac {(e x)^{2 n}}{2 a e n}-\frac {b x^{-n} (e x)^{2 n} \log \left (1+\frac {a e^{c+d x^n}}{b-\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d e n}+\frac {b x^{-n} (e x)^{2 n} \log \left (1+\frac {a e^{c+d x^n}}{b+\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d e n}+\frac {\left (b x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int \log \left (1+\frac {2 a e^{c+d x}}{2 b-2 \sqrt {-a^2+b^2}}\right ) \, dx,x,x^n\right )}{a \sqrt {-a^2+b^2} d e n}-\frac {\left (b x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int \log \left (1+\frac {2 a e^{c+d x}}{2 b+2 \sqrt {-a^2+b^2}}\right ) \, dx,x,x^n\right )}{a \sqrt {-a^2+b^2} d e n} \\ & = \frac {(e x)^{2 n}}{2 a e n}-\frac {b x^{-n} (e x)^{2 n} \log \left (1+\frac {a e^{c+d x^n}}{b-\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d e n}+\frac {b x^{-n} (e x)^{2 n} \log \left (1+\frac {a e^{c+d x^n}}{b+\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d e n}+\frac {\left (b x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int \frac {\log \left (1+\frac {2 a x}{2 b-2 \sqrt {-a^2+b^2}}\right )}{x} \, dx,x,e^{c+d x^n}\right )}{a \sqrt {-a^2+b^2} d^2 e n}-\frac {\left (b x^{-2 n} (e x)^{2 n}\right ) \text {Subst}\left (\int \frac {\log \left (1+\frac {2 a x}{2 b+2 \sqrt {-a^2+b^2}}\right )}{x} \, dx,x,e^{c+d x^n}\right )}{a \sqrt {-a^2+b^2} d^2 e n} \\ & = \frac {(e x)^{2 n}}{2 a e n}-\frac {b x^{-n} (e x)^{2 n} \log \left (1+\frac {a e^{c+d x^n}}{b-\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d e n}+\frac {b x^{-n} (e x)^{2 n} \log \left (1+\frac {a e^{c+d x^n}}{b+\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d e n}-\frac {b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,-\frac {a e^{c+d x^n}}{b-\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d^2 e n}+\frac {b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,-\frac {a e^{c+d x^n}}{b+\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d^2 e n} \\ \end{align*}
Result contains complex when optimal does not.
Time = 3.70 (sec) , antiderivative size = 859, normalized size of antiderivative = 2.80 \[ \int \frac {(e x)^{-1+2 n}}{a+b \text {sech}\left (c+d x^n\right )} \, dx=\frac {(e x)^{2 n} \left (b+a \cosh \left (c+d x^n\right )\right ) \left (1+\frac {2 b x^{-2 n} \left (2 \left (c+d x^n\right ) \arctan \left (\frac {(a+b) \coth \left (\frac {1}{2} \left (c+d x^n\right )\right )}{\sqrt {a^2-b^2}}\right )+2 \left (c-i \arccos \left (-\frac {b}{a}\right )\right ) \arctan \left (\frac {(a-b) \tanh \left (\frac {1}{2} \left (c+d x^n\right )\right )}{\sqrt {a^2-b^2}}\right )+\left (\arccos \left (-\frac {b}{a}\right )+2 \left (\arctan \left (\frac {(a+b) \coth \left (\frac {1}{2} \left (c+d x^n\right )\right )}{\sqrt {a^2-b^2}}\right )+\arctan \left (\frac {(a-b) \tanh \left (\frac {1}{2} \left (c+d x^n\right )\right )}{\sqrt {a^2-b^2}}\right )\right )\right ) \log \left (\frac {\sqrt {a^2-b^2} e^{-\frac {c}{2}-\frac {d x^n}{2}}}{\sqrt {2} \sqrt {a} \sqrt {b+a \cosh \left (c+d x^n\right )}}\right )+\left (\arccos \left (-\frac {b}{a}\right )-2 \left (\arctan \left (\frac {(a+b) \coth \left (\frac {1}{2} \left (c+d x^n\right )\right )}{\sqrt {a^2-b^2}}\right )+\arctan \left (\frac {(a-b) \tanh \left (\frac {1}{2} \left (c+d x^n\right )\right )}{\sqrt {a^2-b^2}}\right )\right )\right ) \log \left (\frac {\sqrt {a^2-b^2} e^{\frac {1}{2} \left (c+d x^n\right )}}{\sqrt {2} \sqrt {a} \sqrt {b+a \cosh \left (c+d x^n\right )}}\right )-\left (\arccos \left (-\frac {b}{a}\right )+2 \arctan \left (\frac {(a-b) \tanh \left (\frac {1}{2} \left (c+d x^n\right )\right )}{\sqrt {a^2-b^2}}\right )\right ) \log \left (\frac {(a+b) \left (-a+b+i \sqrt {a^2-b^2}\right ) \left (-1+\tanh \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )}{a \left (a+b+i \sqrt {a^2-b^2} \tanh \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )}\right )-\left (\arccos \left (-\frac {b}{a}\right )-2 \arctan \left (\frac {(a-b) \tanh \left (\frac {1}{2} \left (c+d x^n\right )\right )}{\sqrt {a^2-b^2}}\right )\right ) \log \left (\frac {(a+b) \left (a-b+i \sqrt {a^2-b^2}\right ) \left (1+\tanh \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )}{a \left (a+b+i \sqrt {a^2-b^2} \tanh \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )}\right )+i \left (\operatorname {PolyLog}\left (2,\frac {\left (b-i \sqrt {a^2-b^2}\right ) \left (a+b-i \sqrt {a^2-b^2} \tanh \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )}{a \left (a+b+i \sqrt {a^2-b^2} \tanh \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )}\right )-\operatorname {PolyLog}\left (2,\frac {\left (b+i \sqrt {a^2-b^2}\right ) \left (a+b-i \sqrt {a^2-b^2} \tanh \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )}{a \left (a+b+i \sqrt {a^2-b^2} \tanh \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )}\right )\right )\right )}{\sqrt {a^2-b^2} d^2}\right ) \text {sech}\left (c+d x^n\right )}{2 a e n \left (a+b \text {sech}\left (c+d x^n\right )\right )} \]
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 0.78 (sec) , antiderivative size = 585, normalized size of antiderivative = 1.91
method | result | size |
risch | \(\frac {x \,{\mathrm e}^{\frac {\left (2 n -1\right ) \left (-i \operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right ) \pi +i \operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i e x \right )^{2} \pi +i \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right )^{2} \pi -i \operatorname {csgn}\left (i e x \right )^{3} \pi +2 \ln \left (e \right )+2 \ln \left (x \right )\right )}{2}}}{2 a n}-\frac {2 b \,{\mathrm e}^{-i \pi n \,\operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right )} {\mathrm e}^{i \pi n \,\operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i e x \right )^{2}} {\mathrm e}^{i \pi n \,\operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right )^{2}} {\mathrm e}^{-i \pi n \operatorname {csgn}\left (i e x \right )^{3}} {\mathrm e}^{\frac {i \operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right ) \pi }{2}} {\mathrm e}^{-\frac {i \operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i e x \right )^{2} \pi }{2}} {\mathrm e}^{-\frac {i \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right )^{2} \pi }{2}} {\mathrm e}^{\frac {i \operatorname {csgn}\left (i e x \right )^{3} \pi }{2}} e^{2 n} {\mathrm e}^{c} \left (\frac {x^{n} d \left (\ln \left (\frac {-a \,{\mathrm e}^{2 c +d \,x^{n}}-{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}{-{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}\right )-\ln \left (\frac {a \,{\mathrm e}^{2 c +d \,x^{n}}+{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}{{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}\right )\right )}{2 \sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}+\frac {\operatorname {dilog}\left (\frac {-a \,{\mathrm e}^{2 c +d \,x^{n}}-{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}{-{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}\right )-\operatorname {dilog}\left (\frac {a \,{\mathrm e}^{2 c +d \,x^{n}}+{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}{{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}\right )}{2 \sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}\right )}{a e n \,d^{2}}\) | \(585\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 1286 vs. \(2 (287) = 574\).
Time = 0.30 (sec) , antiderivative size = 1286, normalized size of antiderivative = 4.19 \[ \int \frac {(e x)^{-1+2 n}}{a+b \text {sech}\left (c+d x^n\right )} \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int \frac {(e x)^{-1+2 n}}{a+b \text {sech}\left (c+d x^n\right )} \, dx=\int \frac {\left (e x\right )^{2 n - 1}}{a + b \operatorname {sech}{\left (c + d x^{n} \right )}}\, dx \]
[In]
[Out]
\[ \int \frac {(e x)^{-1+2 n}}{a+b \text {sech}\left (c+d x^n\right )} \, dx=\int { \frac {\left (e x\right )^{2 \, n - 1}}{b \operatorname {sech}\left (d x^{n} + c\right ) + a} \,d x } \]
[In]
[Out]
\[ \int \frac {(e x)^{-1+2 n}}{a+b \text {sech}\left (c+d x^n\right )} \, dx=\int { \frac {\left (e x\right )^{2 \, n - 1}}{b \operatorname {sech}\left (d x^{n} + c\right ) + a} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(e x)^{-1+2 n}}{a+b \text {sech}\left (c+d x^n\right )} \, dx=\int \frac {{\left (e\,x\right )}^{2\,n-1}}{a+\frac {b}{\mathrm {cosh}\left (c+d\,x^n\right )}} \,d x \]
[In]
[Out]